package georah.map
{

	import georah.carto.Extent;
	import georah.carto.GISCamera;
	import georah.carto.IGISClient;
	import georah.carto.PanZoom;

	/**
	 *
	 * @author yuanm
	 */
	public final class MapValue implements IGISClient
	{
		public function MapValue(width_:Number, height_:Number, srid_:int, centerX_:Number, centerY_:Number, scale_:Number)
		{
			_width=width_;
			_height=height_;
			_srid=srid_;
			_centerX=centerX_;
			_centerY=centerY_;
			_scale=scale_;
		}

		private var _centerX:Number=NaN;

		private var _centerY:Number=NaN;

		private var _height:Number=NaN;

		private var _scale:Number=NaN;

		private var _srid:int=4326;

		private var _width:Number=NaN;

		public final function get SRID():int
		{
			return _srid;
		}

		public final function get camera():GISCamera
		{
			return panZoom;
		}

		public final function get centerX():Number
		{
			return _centerX;
		}

		public final function get centerY():Number
		{
			return _centerY;
		}

		public final function get height():Number
		{
			return _height;
		}

		public final function get panZoom():PanZoom
		{
			return new PanZoom(SRID, centerX, centerY, scale);
		}

		public final function get scale():Number
		{
			return _scale;
		}

		public final function get width():Number
		{
			return _width;
		}
		
		public final function get envelope():Extent
		{
			return panZoom.calcBBox(width, height);
		}

	}
}
